<?php
class IndexController extends Zend_Controller_Action
{
    public function indexAction()
    {
		$n = new Numbers();
		
		for ($i = 1; $i <= 140000; $i++) {
			$d = array(
				'key' => $i,
				'hash' => md5($i),
			);
			$n->insert($d);
		}
    }
    
    public function listAction()
    {
    	$hashes = array(
    		'e10adc3949ba59abbe56e057f20f883e',
            '007202387c4274c570d9cb72943fc873',
            '007203e95299b072b3a5e6f1f3d4c725',
            '0072eb621cb9df9f5b701e09feb41fcd',
            '007491783420080b25639249163d109d',
    	);
    	
    	$a = Zend_Db_Table_Abstract::getDefaultAdapter();
    	
    	foreach ($hashes as $hash) {
    		$sql = $a->select()
    				 ->from('numbers', array('key'))
    				 ->where('hash = ?', $hash);
    		$row = $a->fetchOne($sql);
    		echo "Hash " . $hash . " je z hesla " . $row . "<br />" . PHP_EOL;
    	}
    	die();
    }
}